﻿using SkiaSharp;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace XamarinDemo
{
    /// <summary>
    /// Skia中文字体
    /// </summary>
    public static class SkiaChinaFont
    {
        public static SKTypeface ChinaFont { get; private set; }

        static SkiaChinaFont()
        {
            //加载资源方案，设置字体文件属性为嵌入的资源
            var fontStream = Assembly.GetExecutingAssembly().GetManifestResourceStream("XamarinDemo.DroidSansFallback.ttf");
            ChinaFont = SKTypeface.FromStream(fontStream);
        }
    }
}
